package liumengbaio.lolzhangyoubao.Activity.Activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.GridView;

import java.util.List;

import liumengbaio.lolzhangyoubao.Activity.Adapter.SelectHeroAdapter;
import liumengbaio.lolzhangyoubao.Activity.InFo.AllHeroInfo;
import liumengbaio.lolzhangyoubao.R;

public class SelectHerosActivity extends AppCompatActivity {
    private GridView gridView;
    private List<AllHeroInfo> allheroinfo;
    private SelectHeroAdapter allheroadapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_select_heros);
        initView();
        initData();
    }

    private void initData() {
        allheroinfo  = liumengbaio.lolzhangyoubao.Activity.utils.AllHeroUtils.getAllHerosList(SelectHerosActivity.this);

        allheroadapter = new SelectHeroAdapter(allheroinfo, SelectHerosActivity.this);
        gridView.setAdapter(allheroadapter);
    }

    private void initView() {
        gridView= (GridView) findViewById(R.id.allherogridview);
        findViewById(R.id.edit_head_left_title).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}
